{% extends "test.html"%}
{% import "_macros.html" as mr %}

{% block title %}
<h3>
{{ user.username }}关注的人
</h3>
<p>总有一天，我会和你一样优秀</p>
{% endblock %}

{% block post %}
<table class="table table-hover followers">
    <thead>
    <tr>
        <th>用户</th>
        <th>关注时间</th>
        <th> 操作</th>
    </tr>
    </thead>
    {% for follow in follows %}
    <tr>
        <td>
            <a href="{{ url_for('profileid', username = follow.followed.username) }}">
                <img class=" img-circle" src="{{ follow.followed.avatar }}" width="70" height="70">
                {{ follow.followed.username }}
            </a>
        </td>
        <td>
            {{ follow.times }}

        </td>
 {% if current_user.is_authenticated %}
        {% if follow.followed != current_user%}
        <td>
              {% if not current_user.is_following(follow.followed) %}
            <a href="{{url_for('follow',username=follow.followed.username)}}" class="more_btn">关注</a>
            {% else %}
            <a href="{{url_for('unfollow',username=follow.followed.username)}}" class="more_btn">取消关注</a>
            {% endif %}
        </td>
        {% endif %}
        {%else%}
        <td><a href="{{url_for('follow',username=follow.followed.username)}}" class="more_btn">关注</a></td>
        {% endif %}
    </tr>

    {% endfor %}
</table>
{{ mr.pagination_widget(pagination,'followed_by',user.username)}}
{% endblock%}
{%block col%}
{% endblock%}